<template>
  <div v-if="SongDetail && playerId">
    <!-- 全屏播放器 -->
    <div class="player" v-show="showPlayer">
      <div
        class="bg"
        :style="'background-image: url(' + SongDetail.al.picUrl + ')'"
      ></div>
      <div class="shade"></div>
      <div class="view">
        <div class="button" @click.stop="showPlayer = false">
          <span class="iconfont icon-arrow-down-bold"></span>
        </div>
        <div class="title">
          <h2>{{ SongDetail.name }}</h2>
          <h3>
            <span v-for="(item, index) in SongDetail.ar" :key="index"
              >{{ item.name }}&nbsp;</span
            >
          </h3>
        </div>
        <div class="content">
          <div
            v-show="togglelyric"
            @click="togglelyric = false"
            :class="['img', 'play', { pause: iconplay }]"
          >
            <img :src="SongDetail.al.picUrl" alt="" />
          </div>
          <div class="lyrics" v-show="!togglelyric" @click="togglelyric = true">
            <ul :style="{ top: lyricTop }">
              <li
                v-for="(item, index) in lyric"
                :key="index"
                :class="{ con: currentRow == index }"
              >
                {{ item.text }}
              </li>
            </ul>
          </div>
        </div>
        <div class="btns">
          <div class="iconfont icon-pinglun" @click="getCommentMusic"></div>
          <div
            class="iconfont icon-guanzhu-weiguanzhu"
            @click="getArtistSub"
            v-show="!likeSonger"
          ></div>
          <div
            class="iconfont icon-tianchongxing-"
            @click="getArtistSub"
            v-show="likeSonger"
          ></div>
        </div>
        <div class="range">
          <div class="bar">
            <span class="timeLeft">{{ timeLeft | playerTime }}</span>
            <van-slider
              @change="sliderchange"
              v-model="value"
              inactive-color="#514E4C"
              bar-height="4px"
              active-color="#ee0a24"
            >
              <template #button>
                <div class="custom-button"></div>
              </template>
            </van-slider>
            <span class="timeRight">{{ timeRight | playerTime }}</span>
          </div>
        </div>
        <div class="buttons">
          <div
            class="iconfont icon-liebiaobofang1"
            v-show="type == 1"
            @click="toggleType"
          ></div>
          <div
            class="iconfont icon-24gl-shuffle"
            v-show="type == 2"
            @click="toggleType"
          ></div>
          <div
            class="iconfont icon-shangyiqu-wangyiicon"
            @click="startup"
          ></div>
          <div
            :class="[
              'iconfont',
              iconplay ? 'icon-zanting' : 'icon-zantingtingzhi',
            ]"
            @click.stop="toggleplay"
          ></div>
          <div class="iconfont icon-shangyiqu" @click="lowerFun"></div>
          <div
            class="iconfont icon-shoucang"
            @click="like"
            v-show="!likeType"
          ></div>
          <div
            class="iconfont icon-aixin"
            v-show="likeType"
            @click="like"
          ></div>
        </div>
      </div>
    </div>

    <!-- 迷你播放器 -->
    <div class="mini-player" v-if="SongDetail" @click.stop="showPlayer = true">
      <div :class="['img', 'play', { pause: iconplay }]">
        <img :src="SongDetail.al.picUrl" alt="" />
      </div>
      <div class="text">
        <h2>{{ SongDetail.name }}</h2>
        <h3>
          <span v-for="(item, index) in SongDetail.ar" :key="index"
            >{{ item.name }}&nbsp;</span
          >
        </h3>
      </div>
      <div class="control" @click.stop="toggleplay">
        <span class="iconfont icon-bofang" v-show="iconplay"></span>
        <span class="iconfont icon-zantingtingzhi" v-show="!iconplay"></span>
      </div>
      <div class="list iconfont icon-liebiao" @click.stop="show = true"></div>
    </div>
    <!-- oncanplay	当媒介能够开始播放但可能因缓冲而需要停止时运行脚本 -->
    <!-- loadeddata 	当加载媒介数据时运行脚本 -->
    <!-- 音频播放器 -->
    <audio
      ref="audio"
      hidden
      controls
      :src="musicData"
      @loadeddata="loadeddataFun"
    ></audio>
    <!-- 歌曲列表 -->
    <van-popup
      v-model="show"
      round
      closeable
      position="bottom"
      :style="{ height: '50%' }"
    >
      <div class="card">
        <div class="head">
          <van-icon name="play-circle-o" />
          播放全部<span>(共{{ playerLists.length }}首)</span>
        </div>
        <div
          class="song"
          v-for="(item, index) in playerLists"
          :key="item.id"
          @click="setId(item.id)"
        >
          <div class="num">{{ index + 1 }}</div>
          <div class="right">
            <div :class="{ up: true, red: active == index }">
              {{ item.name }}
            </div>
            <div class="down">{{ item.ar[0].name }}</div>
          </div>
        </div>
      </div>
    </van-popup>

    <!-- 评论列表 -->
    <van-popup
      v-model="commentShow"
      closeable
      position="bottom"
      :style="{ height: '100%' }"
    >
      <van-tabs swipeable>
        <van-tab title="最热评论" class="hotComment">
          <div
            class="hot"
            v-for="(item, index) in hotComments"
            :key="item.commentId"
          >
            <img :src="item.user.avatarUrl" />
            <div class="nickName">
              <h4>{{ item.user.nickname }}</h4>
              <p class="time">{{ item.timeStr }}</p>
              <p class="cont">{{ item.content }}</p>
              <div
                class="fabulous iconfont icon-31dianzan"
                v-show="!item.liked"
                @click="liked(index, item.commentId, 1, 0)"
              >
                {{ item.likedCount }}
              </div>
              <div
                class="fabulous iconfont icon-dianzan_kuai"
                v-show="item.liked"
                @click="liked(index, item.commentId, 0, 0)"
              >
                {{ item.likedCount }}
              </div>
            </div>
          </div>
        </van-tab>
        <van-tab title="最新评论" class="hotComment">
          <div
            class="hot"
            v-for="(item, index) in comments"
            :key="item.commentId"
          >
            <img :src="item.user.avatarUrl" />
            <div class="nickName">
              <h4>{{ item.user.nickname }}</h4>
              <p class="time">{{ item.timeStr }}</p>
              <p class="cont">{{ item.content }}</p>
              <div
                class="fabulous iconfont icon-31dianzan"
                v-show="!item.liked"
                @click="liked(index, item.commentId, 1, 1)"
              >
                {{ item.likedCount }}
              </div>
              <div
                class="fabulous iconfont icon-dianzan_kuai"
                v-show="item.liked"
                @click="liked(index, item.commentId, 0, 1)"
              >
                {{ item.likedCount }}
              </div>
            </div>
          </div>
        </van-tab>
        <!-- 发布评论 -->
        <div class="postComment">
          <input type="text" v-model="comment" />
          <button @click="sumit">发表评论</button>
        </div>
      </van-tabs>
    </van-popup>
  </div>
</template>

<script>
import {
  getSongUrl,
  getSongDetail,
  getLyric,
  getLike,
  getCommentMusic,
  getCommentLike,
  getArtistSub,
} from "@/api/music";
import { getPlaylistDetail } from "@/api/rank";
import { getArtists } from "@/api/singer";
import { getLikelist } from "@/api/userInfo";
import { getComment } from "@/api/mv";
export default {
  props: ["playerId", "listId", "flag", "cloudList"],
  data() {
    return {
      active: false, //当前播放的歌曲的索引
      show: false,
      musicData: "",
      iconplay: true, //播放按钮
      SongDetail: null, //歌曲信息
      value: 0, //滚动条 0-100
      showPlayer: false, //全屏播放器状态
      timeRight: 0, //右侧时间
      timeLeft: 0, //左侧时间
      clearset: null, //定时器
      playerLists: [], //播放列表
      togglelyric: false, //歌词切换
      lyric: [], //歌词数组
      lyricTop: "200px", //歌词位置
      currentRow: 0, //歌词高亮
      type: "1", //1列表播放   2随机播放
      ActiveTimer: null,
      likeList: [], //喜欢音乐的列表
      likeType: false, //是否已收藏歌曲
      likeSonger: false, //是否已收藏歌手
      commentShow: false, // 切换到评论
      hotComments: [], //热门评论
      comments: [], //最新评论
      comment: "", //发表评论内容
    };
  },
  methods: {
    // 收藏歌手
    async getArtistSub() {
      if (!this.likeSonger) {
        //收藏歌手
        this.likeSonger = true;
        this.$toast("已收藏歌手");

        const data = await getArtistSub({
          t: 1,
          id: this.SongDetail.ar[0].id,
        });
        console.log(data);
      } else {
        //取消收藏
        this.$toast("已取消收藏该歌手");
        this.likeSonger = false;
        const data = await getArtistSub({
          t: 0,
          id: this.SongDetail.ar[0].id,
        });
        console.log(data);
      }
    },
    // 发表评论
    async sumit() {
      const data = await getComment({
        t: 1,
        type: 0,
        id: this.playerId,
        content: this.comment,
      });
      if (data.code == 200) {
        this.$toast("发布成功");
      }
      this.comment = "";
    },
    // 获取评论
    async getCommentMusic() {
      const data = await getCommentMusic({ id: this.playerId });
      console.log(data);
      this.hotComments = data.hotComments;
      this.comments = data.comments;
      this.commentShow = true;
    },
    // 点赞   commentType判断是 0:热门评论  1:最新评论    ,t 1: 点赞  0:取消
    async liked(index, commentId, t, commentType) {
      const data = await getCommentLike({
        id: this.playerId,
        cid: commentId,
        t: t,
        type: 0,
      });
      if (data.code == 200) {
        if (commentType == 0) {
          if (t == 1) {
            let flag = true;
            this.$set(this.hotComments[index], "liked", flag);
            this.$set(
              this.hotComments[index],
              "likedCount",
              this.hotComments[index].likedCount + 1
            );
          } else {
            let flag = false;
            this.$set(this.hotComments[index], "liked", flag);
            this.$set(
              this.hotComments[index],
              "likedCount",
              this.hotComments[index].likedCount - 1
            );
          }
        } else {
          if (t == 1) {
            let flag = true;
            console.log(index, flag);
            this.$set(this.comments[index], "liked", flag);
            this.$set(
              this.comments[index],
              "likedCount",
              this.comments[index].likedCount + 1
            );

            console.log("点赞后", this.comments);
          } else {
            let flag = false;
            this.$set(this.comments[index], "liked", flag);
            this.$set(
              this.comments[index],
              "likedCount",
              this.comments[index].likedCount - 1
            );
          }
        }

        console.log("点赞后", this.comments);
      }
      console.log(data);
    },
    // 喜欢该音乐
    async like() {
      if (!this.likeType) {
        console.log("添加收藏", this.playerId);
        this.$toast("已收藏该歌曲");
        const data = await getLike({ id: this.playerId });
        this.likeType = true;
        console.log(data);
      } else {
        // 取消收藏
        console.log("取消收藏", this.playerId);
        this.$toast("取消收藏该歌曲");
        const data = await getLike({ id: this.playerId, like: false });
        console.log(data);
        this.likeType = false;
      }
    },
    // 喜欢音乐列表
    async getLikelist() {
      this.likeList = [];
      const { ids } = await getLikelist();
      const data = ids.findIndex((item) => item == this.playerId);
      this.likeType = data > -1 ? true : false;
      console.log("喜欢音乐的索引:", data);
      console.log(ids);
      for (let i = 0; i < ids.length; i++) {
        const { songs } = await getSongDetail({ ids: ids[i] });
        this.likeList.push(songs[0]);
      }
    },
    // 修改当前播放id
    setId(id) {
      this.$emit("update:player-id", id);
    },

    // 获取歌曲url
    getSongUrlFun() {
      getSongUrl({ id: this.playerId }).then((data) => {
        this.musicData = data.data[0].url;
        this.iconplay = true;
      });
    },
    // 获取歌曲信息
    getSongDetailFun() {
      getSongDetail({ ids: this.playerId }).then((data) => {
        console.log("歌曲信息", data);
        this.SongDetail = data.songs[0];
      });
    },
    // 获取歌曲歌词
    getLyricFun() {
      getLyric({ id: this.playerId }).then((data) => {
        console.log("歌词信息", data);
        this.formatLyric(data.lrc.lyric);
      });
    },
    // 处理歌词结构
    formatLyric(text) {
      this.lyric = [];
      let arr = text.split("\n"); //把原歌词切割成字符串
      let row = arr.length; //获取数组长度
      for (let i = 0; i < row; i++) {
        let temp_row = arr[i]; //[00:00.000] 作词 : MK王逸杰
        let temp_arr = temp_row.split("]"); //[00:00.000 , 作词 : MK王逸杰
        let lyrictext = temp_arr.pop(); //删除数组最后一个,返回值
        temp_arr.forEach((el) => {
          let obj = {};
          // [00:00.000 => [00,00.000]
          let time_arr = el.substr(1, el.length - 1).split(":");
          let s = time_arr[0] * 60 + Math.ceil(time_arr[1]); //把分钟变成秒
          obj.text = lyrictext;
          obj.time = s;
          if (lyrictext.length > 0) {
            this.lyric.push(obj); //每一行歌词处理后放入数组中
          }
        });
      }
    },
    // 播放暂停音乐
    toggleplay() {
      if (this.iconplay) {
        this.$refs.audio.play(); //播放音乐
        clearInterval(this.clearset); //清除定时器
        this.clearset = setInterval(() => {
          this.timeLeft = this.$refs.audio.currentTime; //实时变化时间
          let duration = this.$refs.audio.duration; //总时间
          // 计算滚动条值
          this.value = (this.timeLeft / duration) * 100;
          if (this.value == 100) {
            clearInterval(this.clearset);
            this.$refs.audio.pause(); //暂停音乐
            this.iconplay = true;
            this.timeLeft = 0;
            this.value = 0;
            this.lowerFun();
          }
        }, 999);
      } else {
        this.$refs.audio.pause(); //暂停音乐
        clearInterval(this.clearset);
      }

      this.iconplay = !this.iconplay; //切换页面
    },
    // 音乐加载完成后,获取音乐数据
    async loadeddataFun() {
      // let duration = await this.$refs.audio.duration;
      // this.timeRight = duration;
      this.timeRight = await this.$refs.audio.duration;
      this.toggleplay();
    },
    // 获取滚动条变化
    sliderchange() {
      var duration = (this.$refs.audio.duration * this.value) / 100;
      this.timeLeft = duration; //修改页面数据
      this.$refs.audio.currentTime = duration; //修改播放时间
    },
    // 下一首歌
    lowerFun() {
      // console.log("下一首");
      // 列表播放
      if (this.type == 1) {
        // let id = this.SongDetail.id; // 获取id
        // 获取在播放歌曲列表中下标
        let index = this.playerLists.findIndex(
          (item) => item.id == this.SongDetail.id
        );
        // 1.获取当前歌曲下标,下标加一,下一首歌.如果最后一首歌,重置为零回到第一首歌
        index = index + 1 > this.playerLists.length - 1 ? 0 : index + 1;
        // 返回父组件歌曲id
        this.$emit("update:player-id", this.playerLists[index].id); //修改父组件id值
      } else {
        // let id = this.SongDetail.id; // 获取id
        let index = this.playerLists.findIndex(
          (item) => item.id == this.SongDetail.id
        );
        let index1 = parseInt(Math.random() * this.playerLists.length);
        // 防止重复播放同一首
        if (index == index1) {
          index1 = index + 1;
        }
        // 返回父组件歌曲id
        this.$emit("update:player-id", this.playerLists[index1].id); //修改父组件id值
      }
    },
    // 上一首歌
    startup() {
      if (this.type == 1) {
        let id = this.SongDetail.id; // 获取id
        // 获取在播放歌曲列表中下标
        let index = this.playerLists.findIndex((item) => item.id == id);
        // 1.获取当前歌曲下标,下标减一,上一首歌.如果第一首歌,设置为最后一首歌
        index = index - 1 < 0 ? this.playerLists.length - 1 : index - 1;
        // 返回父组件歌曲id
        this.$emit("update:player-id", this.playerLists[index].id); //修改父组件id值
      } else {
        let index = this.playerLists.findIndex(
          (item) => item.id == this.SongDetail.id
        );
        let index1 = parseInt(Math.random() * this.playerLists.length);
        if (index == index1) {
          index1 = index + 1;
        }
        // 返回父组件歌曲id
        this.$emit("update:player-id", this.playerLists[index1].id); //修改父组件id值
      }
    },
    // 切换播放类型
    toggleType() {
      this.type = this.type == 1 ? "2" : "1";
      if (this.type == 1) {
        this.$toast("列表播放");
      } else {
        this.$toast("随机播放");
      }
    },
  },
  // 侦听器,只要数据修改,重新执行
  watch: {
    // 侦听播放id
    playerId() {
      clearInterval(this.clearset);
      if (this.playerId == null) {
        console.log(111);
      } else {
        this.getLikelist();
        clearTimeout(this.ActiveTimer);
        this.getSongUrlFun(); //歌曲url
        this.getSongDetailFun(); //歌曲信息
        this.getLyricFun(); //歌曲歌词
        //当前播放歌曲索引
        this.ActiveTimer = setTimeout(() => {
          this.active = this.playerLists.findIndex(
            (item) => item.id == this.playerId
          );
        }, 1000);
      }
    },
    // 侦听播放列表id
    listId() {
      // 歌手Id
      if (this.flag) {
        console.log(this.listId);
        getArtists({ id: this.listId }).then((data) => {
          this.playerLists = data.hotSongs; //获取歌单数据
          console.log("歌单数据:歌手", this.playerLists);
          this.$emit("update:flag", false);
        });
      } else {
        // 歌单id
        getPlaylistDetail(this.listId).then((data) => {
          this.playerLists = data.playlist.tracks; //获取歌单数据
          console.log("歌单数据:歌单", this.playerLists);
        });
      }
    },
    // 左测歌时间变化
    timeLeft() {
      for (let i = 0; i < this.lyric.length; i++) {
        if (parseInt(this.timeLeft) <= this.lyric[i].time) {
          this.lyricTop = 200 - i * 36 + "px";
          this.currentRow = i; //歌词高亮
          break;
        }
      }
    },
    // 云盘的歌单
    cloudList() {
      this.playerLists = this.cloudList;
      console.log("历史", this.cloudList);
    },
  },
  filters: {
    playerTime(data) {
      let m = parseInt(data / 60); //分钟
      let s = parseInt(data % 60); //秒
      if (m == 0 && s == 0) {
        return "0:00";
      } else {
        return m + ":" + (s < 10 ? "0" + s : s); // 01
      }
    },
  },
  destroyed() {
    clearInterval(this.clearset);
  },
  created() {
    clearInterval(this.clearset); //清除定时器
  },
};
</script>

<style lang="less" scoped>
.player {
  position: fixed;
  top: 0px;
  left: 0px;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 1);
  color: #fff;
  z-index: 1;
  .bg {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    background-size: 100%;
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(1.8);
    transform-origin: center center;
    filter: blur(30px);
    opacity: 1;
    z-index: 2;
  }
  .shade {
    position: absolute;
    z-index: 3;
    left: 0px;
    bottom: 0px;
    height: 50%;
    width: 100%;
    background-image: linear-gradient(180deg, rgba(0, 0, 0, 0), #000);
  }
  .view {
    position: absolute;
    z-index: 4;
    left: 0px;
    bottom: 0px;
    height: 100%;
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    .button {
      font-size: 22px;
      position: absolute;
      left: 13px;
      top: 13px;
      font-weight: bold;
    }
    .title {
      margin: 0 auto;
      margin-top: 10px;
      text-align: center;
      width: 80%;
      h2 {
        font-size: 20px;
      }
      h3 {
        font-size: 14px;
      }
    }
    .content {
      text-align: center;
      height: 65%;
      width: 100%;
      position: relative;
      .img {
        position: absolute;
        background-color: tr;
        top: 0px;
        left: 0px;
        right: 0px;
        bottom: 0px;
        margin: auto;
        width: 300px;
        height: 300px;
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.3);
        img {
          margin: 0 auto;
          width: 274px;
          height: 274px;
          border-radius: 50%;
          margin-top: 13px;
        }

        &.play {
          animation: rotate 20s linear infinite;
        }
        &.pause {
          animation-play-state: paused;
        }
      }
      .lyrics {
        width: 100%;
        height: 100%;
        position: relative;
        overflow: hidden;
        ul {
          position: absolute;
          width: 100%;
          top: 180px;
          left: 0px;
          transition: all 0.5s linear;
          li {
            height: 36px;
            line-height: 36px;
            color: #cbcccc;
            font-size: 16px;
            overflow: hidden;
            &.con {
              color: #fff;
            }
          }
        }
      }
    }
  }
  .btns {
    display: flex;
    position: absolute;
    justify-content: center;
    bottom: 130px;
    width: 100%;
    .iconfont {
      // flex: 1;
      width: 20%;
      text-align: center;
      font-size: 24px;
      line-height: 38px;
      color: #fff;
    }
  }
  .range {
    position: absolute;
    width: 100%;
    left: 0px;
    bottom: 110px;
    text-align: center;
    .bar {
      width: 66%;
      margin: auto;
      position: relative;
      font-size: 14px;
      .timeLeft {
        position: absolute;
        left: -36px;
        top: -6px;
      }
      .timeRight {
        position: absolute;
        right: -36px;
        top: -6px;
      }
    }
  }
  .buttons {
    display: flex;
    position: absolute;
    bottom: 40px;
    width: 100%;
    .iconfont {
      flex: 1;
      width: 20%;
      text-align: center;
      font-size: 24px;
      line-height: 38px;
      color: #fff;
    }
  }
}
/deep/ .van-popup__close-icon--top-right {
  top: 10px;
  right: 10px;
}
.van-popup {
  background: url("../../assets/bg.webp") no-repeat;
  background-size: 100%;
  height: 100vh;
}
.hotComment {
  overflow-x: hidden;
  height: 88vh;
  .hot {
    padding: 10px 20px;
    display: flex;
    img {
      height: 35px;
      width: 35px;
      border-radius: 50%;
      margin-right: 8px;
    }
    .nickName {
      position: relative;
      flex: 1;
      padding-bottom: 10px;
      border-bottom: 1px solid #afa8a8;
      h4 {
        font-size: 14px;
        color: #4b4b4b;
      }
      .time {
        font-size: 10px;
        color: #bfbfbf;
      }
      .cont {
        font-size: 14px;
        line-height: 20px;
        color: #2c2c2c;
      }
      .fabulous {
        position: absolute;
        right: 0;
        top: 5px;
        font-size: 14px;
      }
    }
  }
}
.postComment {
  position: fixed;
  width: 100%;
  bottom: 0px;
  left: 0;
  display: flex;
  input {
    padding-left: 10px;
    flex: 1;
    height: 5vh;
    line-height: 5vh;
    border: 0;
    margin: 0;
  }
  button {
    margin: 0;
    height: 5vh;
    line-height: 5vh;
    border: 0;
    color: rgb(221, 20, 20);
  }
}
.custom-button {
  width: 16px;
  height: 16px;
  background-color: #d0261a;
  border: 5px solid #fff;
  border-radius: 50%;
}

.mini-player {
  position: fixed;
  left: 0px;
  bottom: 0;
  width: 100%;
  height: 52px;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  .img {
    height: 37px;
    width: 37px;
    margin: 7px 9px 0px 17px;
    background-color: aqua;
    border-radius: 50%;
    img {
      height: 37px;
      width: 37px;
      border-radius: 50%;
    }
    &.play {
      animation: rotate 20s linear infinite;
    }
    &.pause {
      animation-play-state: paused;
    }
  }
  .text {
    width: 60%;
    h2 {
      font-size: 16px;
      line-height: 16px;
      color: #131314;
      margin-top: 12px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      word-break: keep-all;
    }
    h3 {
      line-height: 12px;
      font-size: 12px;
      color: #929393;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      word-break: keep-all;
    }
  }
  .control {
    position: relative;
    text-align: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    line-height: 26px;
    border: 2px solid #929393;
    margin: 11px 14px 0 0;
    .iconfont {
      position: absolute;
      top: -1px;
      left: 5px;
      color: #464848;
      font-size: 12px;
    }
  }
  .list {
    margin-top: 10px;
    font-size: 29px;
  }
}
.card {
  // height: 100vh;
  background: url("../../assets/bg.webp") no-repeat;
  background-size: cover;
  height: 50vh;
  overflow-x: hidden;
  margin: 0 1px;
  min-height: 50vh;
  position: relative;
  font-size: 15px;
  line-height: 15px;
  border-radius: 7px;
  .head {
    padding: 9px 14px;
    color: #484a4a;
    .van-icon {
      margin-right: 11px;
    }
    span {
      line-height: 16px;
      height: 16px;
      font-size: 15px;
      color: #b5b6b6;
    }
  }
  .song {
    padding: 12px 14px 9px;
    height: 55px;
    align-items: center;
    display: flex;
    .num {
      font-size: 11px;
      width: 31px;
      padding-left: 4px;
      color: #484a4a;
    }
    .right {
      width: 80%;
      .up {
        width: 80%;
        font-size: 16px;
        margin-bottom: 7px;
        color: #484a4a;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        word-break: keep-all;
      }
      .red {
        color: #d0261a;
      }
      .down {
        width: 80%;
        font-size: 11px;
        color: #302b2b;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        word-break: keep-all;
      }
    }
  }
}
@keyframes rotate {
  0% {
    transform: rotate(0);
  }
  100% {
    transform: rotate(360deg);
  }
}
</style>
